{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# Customized OTC option\n",
    "\n",
    "1. dcn: phoenix option without ki barrier, but has coupon barrier\n",
    "\n",
    "2. fcn: phoenix option without coupon barrier with ki observation only on last day\n",
    "\n"
   ],
   "id": "447b783d03f6b00"
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": [
    "from qdpmc import *\n",
    "daily_d_arr = list(range(1, 253))\n",
    "monthly_d_arr  = list(range(21, 253, 21))\n",
    "settle_rebate = np.linspace(15/12, 15, 12)\n",
    "coupon_rebate = np.zeros(12)\n",
    "mc = MonteCarlo(100, 1000000)\n",
    "bs = BlackScholes(0.03, 0.03, 0.22, 244)\n",
    "dcn = StandardPhoenix(spot=100.0, barrier_out= 100.0, barrier_in=0.0, barrier_coupon=80.0,\n",
    "                      ob_days_in=daily_d_arr, ob_days_out=monthly_d_arr,\n",
    "                      ob_days_coupon=coupon_rebate, ko_coupon=coupon_rebate, maturity_coupon=0.0,\n",
    "                      delta_coupon=settle_rebate)\n",
    "print(dcn.calc_value(mc, bs))\n",
    "\n"
   ],
   "id": "35d768ea7e09c618",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "import numpy as np",
   "id": "fb9e01ac90458401",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "",
   "id": "86461252269ae26",
   "outputs": [],
   "execution_count": null
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
